{% load i18n %}
<thead>
    <tr>
    <!-- SELECT -->
    {% ifequal query.pop 'pop=1' %}<th></th>{% endifequal %}
    {% ifequal query.pop 'pop=2' %}<th></th>{% endifequal %}
    <!-- FILETYPE -->
    {% ifequal query.o '7' %}<th class="sorted {{ query.ot }}ending"><a href="?{{ query.query_nosort }}&amp;ot={{ query.ot_new }}&amp;o=7">{% trans 'Type' %}</a></th>{% endifequal %}
    {% ifnotequal query.o '7' %}<th><a href="?{{ query.query_nosort }}&amp;ot=asc&amp;o=7">{% trans 'Type' %}</a></th>{% endifnotequal %}
    <!-- THUMB -->
    {% ifnotequal counter.Image 0 %}{% if results_var.change_total %}<th>&nbsp;</th>{% endif %}{% endifnotequal %}
    <!-- FILENAME / DIMENSIONS  -->
    {% ifequal query.o '9' %}<th class="sorted {{ query.ot }}ending"><a href="?{{ query.query_nosort }}&amp;ot={{ query.ot_new }}&amp;o=9">{% trans 'Filename' %}</a></th>{% endifequal %}
    {% ifnotequal query.o '9' %}<th><a href="?{{ query.query_nosort }}&amp;ot=asc&amp;o=9">{% trans 'Filename' %}</a></th>{% endifnotequal %}
    <!-- SIZE -->
    {% ifequal query.o '1' %}<th class="sorted {{ query.ot }}ending"><a href="?{{ query.query_nosort }}&amp;ot={{ query.ot_new }}&amp;o=1">{% trans 'Size' %}</a></th>{% endifequal %}
    {% ifnotequal query.o '1' %}<th><a href="?{{ query.query_nosort }}&amp;ot=asc&amp;o=1">{% trans 'Size' %}</a></th>{% endifnotequal %}
    <!-- DATE -->
    {% ifequal query.o '3' %}<th class="sorted {{ query.ot }}ending"><a href="?{{ query.query_nosort }}&amp;ot={{ query.ot_new }}&amp;o=3">{% trans 'Date' %}</a></th>{% endifequal %}
    {% ifnotequal query.o '3' %}<th><a href="?{{ query.query_nosort }}&amp;ot=asc&amp;o=3">{% trans 'Date' %}</a></th>{% endifnotequal %}
    <!-- RENAME -->
    <th>&nbsp;</th>
    <!-- CHANGE -->
    {% if not query.pop %}{% if results_var.change_total %}{% if settings_var.USE_SNIPSHOT or settings_var.USE_PICNIK %}<th>&nbsp;</th>{% endif %}{% endif %}{% endif %}
    <!-- DELETE -->
    {% if results_var.delete_total %}<th>&nbsp;</th>{% endif %}
    </tr>
</thead>